﻿@using NewLife.Common;
@using NewLife.Cube
@using NewLife.Cube.WebMiddleware
@{
    var set = NewLife.Cube.CubeSetting.Current;
    var pageSetting = ViewBag.PageSetting as PageSetting ?? PageSetting.Global;

    var res = set.ResourceUrl;
    if (String.IsNullOrEmpty(res)) res = "/Content";
    res = res.TrimEnd('/');
}
<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - @SysConfig.Current.DisplayName</title>
    <meta name="description" content="@SysConfig.Current.Company" />
    <meta name="keywords" content="@SysConfig.Current.Company" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="shortcut icon" href="~/favicon.ico" />
    <!-- 自定义样式 -->
    @RenderSection("css", required: false)
    <!-- 核心脚本 -->
    <link rel="stylesheet" href="~/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="~/style/admin.css" media="all">
            <!-- JQuery作为一等公民，页面内部随时可能使用 -->
    <script src="@res/js/jquery-2.1.3.min.js"></script>
            <!-- 全局脚本 -->
    <script src="~/layui/layui.js"></script>
    
</head>
<!--begin::Body-->
<body class="layui-layout-body">
  @RenderBody()
    @if (pageSetting.EnableFooter)
    {
        @await Html.PartialAsync("_Layout_Footer")
    }
    <!----------------------------------------以下为Javascript脚本区域----------------------------------------------------------------->
    <script>
      layui.config({
        base: '../../../' //静态资源所在路径
      }).extend({
        index: '../../../lib/index' //主入口模块
      }).use(['index', 'table',"laydate","dropdown","form","upload",'treeTable', 'util', 'xmSelect','notice','jquery', 'tagsInput','excel','soulTable'],function(){
          var admin = layui.admin
        ,table = layui.table
        ,soulTable = layui.soulTable
        ,laydate = layui.laydate
        ,dropdown = layui.dropdown
        ,layer = layui.layer
        ,form = layui.form
        ,upload = layui.upload
        ,treeTable = layui.treeTable
        ,util = layui.util
        ,xmSelect = layui.xmSelect
        ,notice = layui.notice
        ,$ = layui.jquery
        ,laytpl = layui.laytpl
        ,tagsInput = layui.tagsInput
        ,excel = layui.excel
        ,slider = layui.slider;
        @RenderSection("layuiscripts", required: false)
        form.render(null, 'component-form-group');

        laydate.render({
          elem: '#LAY-component-form-group-date'
        });

        //form.on('radio(choiceradio)', function(data){
        //    $("input[lay-filter=choiceradio]").attr("checked",false);
        //    $("input[lay-filter=choiceradio][value="+data.value+"]").attr("checked", true);
        //    $("input[type=hidden][lay-filter=choiceradio]").val(data.value);
        //});  

        /* 自定义验证规则 */
        form.verify({
          name: [/^[a-zA-Z][a-zA-Z0-9_]{5,20}$/, '用户名以字母开头，要求5-20位且包含字母数字下划线']
          ,pass: [/(.+){8,20}$/, '密码太弱，要求8-20位且包含数字大小写字母和符号']
          ,content: function(value){
            layedit.sync(editIndex);
          }
        });
    
      });
      
    
    function stringJson(formid){
            var formdata = $(formid).serializeArray();
            var data = {};
            $(formdata ).each(function(index, obj){
                data[obj.name] = obj.value;
            });
          return data;
    }
    </script>
    <!--自定义脚本-->
    @RenderSection("scripts", required: false)
</body>
<!--end::Body-->
</html>